import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { JVxeTypes, JVxeColumn } from '/@/components/jeecg/JVxeTable/types';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '盘点单号',
    align: 'center',
    dataIndex: 'inventoryNumber',
  },
  {
    title: '盘点单名',
    align: 'center',
    dataIndex: 'inventoryName',
  },
  {
    title: '审核状态',
    align: 'center',
    dataIndex: 'checkState',
  },
  {
    title: '盘点单状态',
    align: 'center',
    dataIndex: 'inventoryState',
  },
  {
    title: '盘点方式',
    align: 'center',
    dataIndex: 'inventoryWay',
  },
  {
    title: '备注',
    align: 'center',
    dataIndex: 'notes',
  },
  {
    title: '盘点类型',
    align: 'center',
    dataIndex: 'inventoryType',
  },
  {
    title: '盘点人员',
    align: 'center',
    dataIndex: 'inventoryPerson',
  },
  {
    title: '资产分类名称',
    align: 'center',
    dataIndex: 'categoryName',
  },
  {
    title: '资产使用状态',
    align: 'center',
    dataIndex: 'useState',
  },
  {
    title: '使用部门',
    align: 'center',
    dataIndex: 'departmentId',
  },
  {
    title: '使用人',
    align: 'center',
    dataIndex: 'user',
  },
  {
    title: '位置名称',
    align: 'center',
    dataIndex: 'positionName',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '盘点单号',
    field: 'inventoryNumber',
    component: 'Input',
  },
  {
    label: '盘点单名',
    field: 'inventoryName',
    component: 'Input',
  },
  {
    label: '审核状态',
    field: 'checkState',
    component: 'Input',
  },
  {
    label: '盘点单状态',
    field: 'inventoryState',
    component: 'Input',
  },
  {
    label: '盘点方式',
    field: 'inventoryWay',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'notes',
    component: 'Input',
  },
  {
    label: '盘点类型',
    field: 'inventoryType',
    component: 'Input',
  },
  {
    label: '盘点人员',
    field: 'inventoryPerson',
    component: 'Input',
  },
  {
    label: '资产分类名称',
    field: 'categoryName',
    component: 'Input',
  },
  {
    label: '资产使用状态',
    field: 'useState',
    component: 'Input',
  },
  {
    label: '使用部门',
    field: 'departmentId',
    component: 'Input',
  },
  {
    label: '使用人',
    field: 'user',
    component: 'Input',
  },
  {
    label: '位置名称',
    field: 'positionName',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
//子表单数据
//子表表格配置
export const inventoryResultColumns: JVxeColumn[] = [];
export const inventoryTaskColumns: JVxeColumn[] = [
  {
    title: '实盘数量',
    key: 'actualCount',
    type: JVxeTypes.inputNumber,
    width: '200px',
    placeholder: '请输入${title}',
    defaultValue: '',
  },
  {
    title: '实际位置',
    key: 'actualPosition',
    type: JVxeTypes.input,
    width: '200px',
    placeholder: '请输入${title}',
    defaultValue: '',
  },
];

/**
 * 流程表单调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
